import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.event.*;


public class ManageAccount extends JPanel implements ActionListener
{
	private JPanel top, mid, bot, main, top1, top2, top3, mid1, mid2, bot1;
        private JLabel titleTop, titleMid;
        private JLabel titleTop2, titleMid2;
        private JLabel oPass, nPass, cPass, nEmail, cEmail, empty;
        private JTextField op, np, cp, ne, ce;
        private JButton confirm, cancel;

	public ManageAccount (int ID, int userType) {
            titleTop = new JLabel("Change Password");
            titleMid = new JLabel("Change Email Address");
            titleTop2 = new JLabel("Leave blank to keep unchanged.");
            titleMid2 = new JLabel("Leave blank to keep unchanged.");
            oPass = new JLabel("Old Password:   ");
            nPass = new JLabel("New Password:   ");
            cPass = new JLabel("Confirm Password:   ");
            nEmail = new JLabel("New Eamil:   ");
            cEmail = new JLabel("Confirm Email:   ");
            empty = new JLabel("");
            op = new JTextField("");
            np = new JTextField("");
            cp = new JTextField("");
            ne = new JTextField("");
            ce = new JTextField("");
            confirm = new JButton("Confirm");
            cancel = new JButton("Cancel");
            
            top = new JPanel();
            top1 = new JPanel();
            top2 = new JPanel();
            top3 = new JPanel();
            mid = new JPanel();
            mid1 = new JPanel();
            mid2 = new JPanel();
            bot = new JPanel();
            bot1 = new JPanel();
            main = new JPanel();
            
            main.setLayout(new GridLayout(3, 1));
            add(main);
            main.add(top);
            main.add(mid);
            main.add(bot);
            
            top.setLayout(new GridLayout(6, 1));
            top.add(titleTop);
            top.add(titleTop2);
            top.add(top1);
            top1.setLayout(new GridLayout(1, 2));
            top1.add(oPass);
            top1.add(op);
            top.add(top2);
            top2.setLayout(new GridLayout(1, 2));
            top2.add(nPass);
            top2.add(np);
            top.add(top3);
            top3.setLayout(new GridLayout(1, 2));
            top3.add(cPass);
            top3.add(cp);
            
            mid.setLayout(new GridLayout(4, 2));
            mid.add(titleMid);
            mid.add(titleMid2);
            mid.add(mid1);
            mid1.setLayout(new GridLayout(1, 2));
            mid1.add(nEmail);
            mid1.add(ne);
            mid.add(mid2);
            mid2.setLayout(new GridLayout(1, 2));
            mid2.add(cEmail);
            mid2.add(ce);
            
            bot.setLayout(new BorderLayout());
            bot.add(empty, BorderLayout.CENTER);
            bot.add(bot1, BorderLayout.PAGE_END);
            bot1.setLayout(new GridLayout(1, 2));
            bot1.add(confirm);
            bot1.add(cancel);
            
            confirm.addActionListener(this);
            cancel.addActionListener(this);
        }
        
        public void actionPerformed (ActionEvent e) {
            Object src = e.getSource();
            if (src == confirm) {
                
            } else if (src == cancel) {
                op.setText("");
                np.setText("");
                cp.setText("");
                ne.setText("");
                ce.setText("");
            }
           
        }
}